1 <HTML><HEAD><TITLE>Juce Plugin Test
</TITLE></HEAD>
6 function printmessage(arg
)
8 document
.getElementById ("result").innerHTML
+= "<p>" + arg
+ "</p>";
13 return document
.getElementById ("plugin");
16 function showAMessage()
18 var response
= getPlugin().printText ("This is a message sent from the website's javascript...");
19 printmessage (response
);
22 function popUpMessageBox()
24 // fetch a couple of properties from the plugin and tell the plugin to show them in a pop-up box..
25 getPlugin().popUpMessageBox ("property1 = " + getPlugin().property1
26 + "\nproperty2 = " + getPlugin().property2
);
29 // callbacks from plugin...
30 function WebpageCallbacks()
32 this.printmessage
= printmessage
;
35 function sendCallbackObjectToPlugin()
37 // This gives the plugin an object containing methods that it can call, so that it
38 // can trigger events in the webpage..
39 getPlugin().registerCallbackObject (new WebpageCallbacks());
45 if (navigator
.appName
== "Microsoft Internet Explorer")
47 document
.write('<object id="plugin" type="application/npjucedemo-plugin" classid="CLSID:F683B990-3ADF-11DE-BDFE-F9CB55D89593" width="80%" height="400"></object>');
51 document
.write('<embed id="plugin" src="" type="application/npjucedemo-plugin" width="80%" height="400"></embed>');
56 <embed id=
"plugin" src=
"" type=
"application/npjucedemo-plugin" width=
"80%" height=
"400"></embed>
60 <form name=
"formname">
61 <input type=button
value=
"Tell the plugin to show a message" onclick='showAMessage()'
>
62 <input type=button
value=
"Tell the plugin to show a pop-up" onclick='popUpMessageBox()'
>
63 <input type=button
value=
"Pass a callback object to the plugin" onclick='sendCallbackObjectToPlugin()'
>
66 <div id=
"result"></div>